home *** CD-ROM | disk | FTP | other *** search
/ Day Cry / Day Cry CD.bin / oh_towns / ein / sources / einlib.lzh / LIBSRC.LZH / EIN_FS05.C < prev    next >
C/C++ Source or Header  |  1994-07-18  |  2KB  |  77 lines

  1. /*<Header>==============================================================
  2. *
  3. *    STRINGS OPERATION / "EIN_ST05.C"
  4. *
  5. *        [ EIN(tm) project : ò╢ÄÜù±æÇì∞òΓÅòè╓ÉöîQ ]
  6. *
  7. *    COPYRIGHT  Nam & é▌é±é╜é┴ü⌠  1994, All rights reserved.
  8. *
  9. *-----------------------------------------------------------------------
  10. *    V1.0L01â┐    94.07.16/Nam    âvâìâgâ^âCâv(é▌é±é╜é┴ü⌠é│é±é╠è╓Éöé≡ùÿùp)
  11. *</Header>==============================================================*/
  12. #include    <stdio.h>
  13. #include     <stdlib.h>
  14. #include     <string.h>
  15. #include    <snd.h>
  16. #include    <winb.h>
  17. #include    <te.h>
  18. #include    <fntb.h>
  19. #include    <gui.h>
  20.  
  21. #define    EIN_FSTR
  22. #include    "..\eintm.h"
  23.  
  24. #ifndef NOERR
  25. #define    NOERR    (0)
  26. #endif
  27. #ifndef ERROR
  28. #define    ERROR    (1)
  29. #endif
  30.  
  31. extern char    *EIN_strrchr( char *, char );
  32. extern int    EIN_fnameNonDirectory( char *, char * );
  33.  
  34. /*<Func>================================================================
  35. *    int        EIN_fnameNonExt( char *src, char *dst )
  36. *
  37. *    üyèT  ùvüz    âpâXû╝é⌐éτâfâBâîâNâgâèé╞ègÆúÄqé≡Å£éóé╜âtâ@âCâïû╝é≡ò╘é╖üB
  38. *
  39. *    üyï@  ö\üz    
  40. *
  41. *    üyôⁿ  ù═üz*src        :
  42. *
  43. *    üyÅo  ù═üz*dst        :
  44. *
  45. *    üyè╓ÉöÆlüz    ==0            É│ÅφÅIù╣
  46. *                !=0            ê┘ÅφÅIù╣
  47. *
  48. *    üyÆì  ê╙üz    
  49. *
  50. *    üyÄQ  Å╞üz    EIN_strrchr
  51. *
  52. *-----------------------------------------------------------------------
  53. *    V11L10    1994.07.16/Nam
  54. *</Func>==============================================================*/
  55. int        EIN_fnameNonExt( char *src, char *dst )
  56. {
  57.     char            *fnp;    /* âtâ@âCâïû╝ë≡É═â|âCâôâ^ */
  58.     char            fn[128];
  59.     register int    ret = ERROR;
  60.     
  61.     if ( src==NULL || dst==NULL ){
  62.         return ret;
  63.     }
  64.     /* é▄é╕âtâ@âCâïû╝òöé≡ò¬ùú */
  65.     EIN_fnameNonDirectory( src, fn );
  66.     /* âtâ@âCâïû╝é╞ègÆúÄqé╠ïµÉ╪éΦé≡âTü[â` */
  67.     if ((fnp = EIN_strrchr(fn, '.')) != NULL) {    /* ègÆúÄqéáéΦ?        */
  68.         strncpy(dst, fn, (fnp-fn));    /* âtâ@âCâïû╝âRâsü[    */
  69.         *(dst+(fnp-fn)) = '\0';
  70.         ret = NOERR;
  71.     } else {
  72.         strcpy(dst,"");
  73.     }
  74.     return ret;
  75. }
  76.  
  77.